package com.mydomain.Bodega;

import com.mydomain.Bodega.*;
import java.math.BigDecimal;
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.framework.EntityHome;

@Name("invEgresoItemHome")
public class InvEgresoItemHome extends EntityHome<InvEgresoItem> {

	@In(create = true)
	InvEgresoHome invEgresoHome;
	@In(create = true)
	InvItemStockHome invItemStockHome;

	public void setInvEgresoItemEgrCodigoItem(BigDecimal id) {
		setId(id);
	}

	public BigDecimal getInvEgresoItemEgrCodigoItem() {
		return (BigDecimal) getId();
	}

	@Override
	protected InvEgresoItem createInstance() {
		InvEgresoItem invEgresoItem = new InvEgresoItem();
		return invEgresoItem;
	}

	public void wire() {
		getInstance();
		InvEgreso invEgreso = invEgresoHome.getDefinedInstance();
		if (invEgreso != null) {
			getInstance().setInvEgreso(invEgreso);
		}
		InvItemStock invItemStock = invItemStockHome.getDefinedInstance();
		if (invItemStock != null) {
			getInstance().setInvItemStock(invItemStock);
		}
	}

	public boolean isWired() {
		return true;
	}

	public InvEgresoItem getDefinedInstance() {
		return isIdDefined() ? getInstance() : null;
	}

}
